﻿using Client.Model;
using Client.ViewModel.MenuViewModel;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Client.View.MenuView
{
    /// <summary>
    /// MenuEdit.xaml 的交互逻辑
    /// </summary>
    public partial class MenuEdit : Window
    {

        public MenuEdit()
        {
            InitializeComponent();
            MenuEditViewModel = new MenuEditViewModel(this);
            DataContext = MenuEditViewModel;
        }

        public MenuEditViewModel MenuEditViewModel { get; private set; }

        public void BindParentContextAndEntity(MenuListViewModel dataContext = null, ViewMenu menu = null)
        {
            MenuEditViewModel.Init(menu, dataContext);
        }


        protected override void OnClosing(CancelEventArgs e)
        {
            e.Cancel = true;
            this.Hide();
        }

    }
}
